package com.example.demo;

import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.J2Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {
   // @Autowired
    //private CacheChannel cacheChannel;
    public static void main(String[] args) {

        SpringApplication.run(DemoApplication.class, args);
     /*   DemoApplication  wsss=  new DemoApplication();
        wsss.qqq();*/

        CacheChannel cache = J2Cache.getChannel();

        //缓存操作
        cache.set("default", "1", "Hello J2Cache");
        System.out.println(cache.get("default", "1"));
        cache.evict("default", "1");
        System.out.println(cache.get("default", "1"));

        cache.close();
    }

   /* public void qqq(){
        cacheChannel.clear("23223");
        System.out.println("YES!!!!!!!");
    }*/

}
